package com.example.spring2301.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyConfig {

    @Autowired
    CustomerByAnno customer;

    public void setInfo() {
        customer.setId(2222);
        customer.setUsername("admin111");
        customer.setPassword("8888");
    }

    public void getInfo() {
        System.out.println("id=" +customer.getId() + "username = " +
                customer.getUsername() + "密码=" + customer.getPassword());
    }


    @Bean
    public CustomerByAnno getCustomer() {
        CustomerByAnno cu = new CustomerByAnno();
        cu.setId(2222);
        cu.setUsername("admin111");
        cu.setPassword("8888");
        return cu;
    }

}
